// =============================================================================
// COMMIT LIST
// =============================================================================

.commit-list, .task-list {
  list-style-type: none;
  margin: 0; padding: 0;
}

.commit-list-actions {
  float: right;
}

.commit, .task {
  padding: .75rem 0;
  display: flex;
  flex-direction: column;

  @include media(desktop) {
    flex-direction: row;
    align-items: center;
  }

  & + & {
    border-top: 1px solid #e5e5e5;
  }
}


// COMMIT AUTHOR
// -----------------------------------------------------------------------------

.commit-author {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  width: 10em;

  @include media(tablet-down) {
    margin-bottom: 1rem;
  }

  @include media(desktop) {
    margin-right: 1rem;
  }
}

.commit-author__avatar {
  width: 40px;
  height: 40px;
  border-radius: $border-radius;
  margin-right: 0.5rem;
}

.commit-author__name {
  font-size: 0.8em;
}

.commit-author__name__real-name {
  font-weight: 500;
  color: #555;
  display: block;
}

.commit-author__name__username {
  color: #999;
}


// COMMIT DETAILS
// -----------------------------------------------------------------------------

.commit-details {
  flex-grow: 1;

  @include media(tablet-down) {
    margin-bottom: 1rem;
    order: -1;
  }
}

.commit-title {
  font-size: 1em;
  display: block;

  @include media(desktop) {
    @include truncate;
  }
}

.commit-title a {
  color: #333;
}

.commit-meta {
  font-size: 0.8em;
  color: #999;
  margin: 0;

  @include media(desktop) {
    @include truncate;
  }
}

.utc-timecode {
  color: #bbb;
}

.code-additions {
  color: $green;
}

.code-deletions {
  color: $red;
}


// COMMIT ACTIONS
// -----------------------------------------------------------------------------

.commit-actions {
  flex-shrink: 0;

  @include media(desktop) {
    margin-left: 1rem;
  }
}


// STATUS
// -----------------------------------------------------------------------------

.status-group {
  position: relative; // Required to position the status-items div correctly
  .status-item.ignored {
    opacity: .5;
  }
}

.status {
  flex-shrink: 0;

  @include media(tablet-down) {
    margin-bottom: 1rem;
    order: -2;
  }

  @include media(desktop) {
    margin-right: 0.75rem;
  }
}

.status {
  display: inline-block;
  border: 2px solid #ccc;
  border-radius: 50%;
  width: 2.25rem;
  height: 2.25rem;

  .status__icon {
    display: block;
    width: 100%;
    height: 100%;
    background: asset-data-url("unknown.svg") center center no-repeat;
  }
}

.status--pending,
[data-deploy-status='pending'] {
  .status__icon {
    background-image: asset-data-url("pending.gif");
    background-size: 21px 5px;
  }
}

.status--running,
[data-deploy-status='running'] {
  border-color: $blue;

  .status__icon {
    background-image: asset-data-url("deploying.svg");
    animation: rotate 2s linear infinite;
  }
}


.status--aborting,
[data-deploy-status='aborting'] {
  border-color: $orange;

  .status__icon {
    background-image: asset-data-url("aborting.svg");
    animation: rotate 2s linear infinite;
  }
}

.status--aborted,
[data-deploy-status='aborted'] {
  border-color: $orange;

  .status__icon {
    background-image: asset-data-url("aborted.svg");
  }
}

.status--flapping,
[data-deploy-status='flapping'] {
  border-color: $orange;

  .status__icon {
    background-image: asset-data-url("flapping.svg");
  }
}

.status--success,
[data-deploy-status='success'] {
  border-color: $green;

  .status__icon {
    background-image: asset-data-url("success.svg");
  }
}

.status--failure,
.status--failed,
[data-deploy-status='failure'],
[data-deploy-status='failed'] {
  border-color: $bright-red;

  .status__icon {
    background-image: asset-data-url("failure.svg");
  }
}

.status--error,
[data-deploy-status='error'] {
  border-color: #333;

  .status__icon {
    background-image: asset-data-url("error.svg");
  }
}


// =============================================================================
// COMMIT SUMMARY
// =============================================================================

.commit-summary-list {
  list-style-type: none;
  margin: 1.5rem 0 0;
  padding: 0;
}

.commit-summary {
  display: flex;
  margin-bottom: .5em;
}

.commit-summary__avatar {
  margin-right: .5rem;
}

.commit-summary__avatar img {
  border-radius: 4px;
}

.commit-summary__title {
  flex-grow: 1;
}

.commit-summary__title a {
  color: #555;
}

.commit-summary__sha {
  font-size: 0.875rem;
  color: #999;
}
